package com.example.springapp;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@ComponentScan  // spring可以管理的类的范围定义
@MapperScan("com.example.springapp.mapper")
public class Myconfig implements WebMvcConfigurer {
    //    拦截并跳转到默认页面
    public void addViewControllers( ViewControllerRegistry registry ) {
        registry.addViewController( "/" ).setViewName( "forward:/shopCata" +
                "" );
    }
}